#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "../game_func.h"
#include "../game_type.h"
#include "../game_api.h"

//-------------------------------------------------------------------------------
//            stage.c 游戏关卡总文件 by 海叔&飞天雪 2020-04-29
//本文件用于存放关卡的总配置表和通用的关卡配置以及函数等，具体内容还需要大量补充。
//-------------------------------------------------------------------------------


/*
--------------------------------------
关卡表结构体 by 海叔
更新日期:2020-04-29
说明:
只是把结构体导出，命名还需更规范化
--------------------------------------
*/
struct StageSetting{//size 0x2a
	char Flag;//场景测试用 固定为01
	char Type;//未使用
	int MotionFunc1;//调用场景第一个函数
	int MotionFunc2;//调用场景第二个函数
	int MotionFunc3;//调用场景第三个函数
	int MotionFunc4;//调用场景第四个函数
	int MotionFunc5;//调用场景第五个函数
	int MotionFunc6;//调用场景第六个函数
	int iVar1;//未确定功能
	int MusicPackPtr;//背景音乐包指针
	int MusicCount;//音乐包包含的音乐数量
	int Func_GetMotionTimeSetting;//取场景表时间的函数
};


/*
--------------------------------------
场景表结构体 by 海叔
更新日期:2020-04-29
说明:
只是把结构体导出，命名还需更规范化
--------------------------------------
*/
struct MotionSetting{//size 0x1a
	int Func1;//场景第一个函数
	int Func2;//场景第二个函数
	int Func3;//场景第三个函数
	int Func4;//场景第四个函数
	int Func5;//场景第五个函数
	int Func6;//场景第六个函数
	short Time;//场景时间
};




/*
----------------------------------------------------------------------------------
第一关场景表-原版 by 海叔
更新日期:2020-04-29
说明：
第一关 平顶山的场景表

DAT_207bee:
	00 15 3E 66 00 15 40 D8 00 15 48 14 00 15 48 4A 00 15 48 6E 00 15 40 80 00 63
	00 15 4B B2 00 15 5C B4 00 15 64 BA 00 15 67 28 00 15 67 62 00 15 4C 0C 00 63
	00 15 6B 02 00 15 6F 38 00 15 73 0E 00 15 73 60 00 15 73 84 00 15 6E D8 00 63
	00 15 4C 7A 00 15 5C B4 00 15 64 BA 00 15 67 28 00 15 67 62 00 15 4D BC 00 63
	00 15 76 B4 00 15 78 7A 00 15 79 E8 00 15 79 FC 00 15 7A 42 00 15 78 1A 00 63
	00 15 7B BC 00 15 7D 98 00 15 7F 46 00 15 7F 6A 00 15 7F B0 00 15 7D 38 00 63
----------------------------------------------------------------------------------
*/
const struct MotionSetting Stage1MotionTbl[]={
	{0x153e66,0x1540d8,0x154814,0x15484a,0x15486e,0x154080,0x63},//场景1 平顶山入口
	{0x154bb2,0x155cb4,0x1564ba,0x156728,0x156762,0x154c0c,0x63},//场景2 平顶山A洞
	{0x156b02,0x156f38,0x15730e,0x157360,0x157384,0x156ed8,0x63},//场景3 平顶山B洞
	{0x154c7a,0x155cb4,0x1564ba,0x156728,0x156762,0x154dbc,0x63},//场景4 平顶山大银角坑
	{0x1576b4,0x15787a,0x1579e8,0x1579fc,0x157a42,0x15781a,0x63},//场景5 平顶山小银角洞
	{0x157bbc,0x157d98,0x157f46,0x157f6a,0x157fb0,0x157d38,0x63},//场景6 平顶山金角路
};



/*
----------------------------------------------------------------------------------
第二关场景表-原版 by 海叔
更新日期:2020-04-29
说明：
第二关 枯松涧的场景表

DAT_21a6fe:
	00 15 F8 06 00 15 FB 8C 00 16 01 4C 00 16 01 70 00 16 02 38 00 00 00 00 00 1E
	00 15 9F 7A 00 15 A1 D8 00 15 A8 5E 00 15 A8 A4 00 15 A9 70 00 00 00 00 00 63
	00 15 A9 E4 00 15 AE 5C 00 15 B5 82 00 15 B5 CE 00 15 B5 E0 00 00 00 00 00 3C
	00 15 B5 F4 00 15 BA C8 00 15 BC 10 00 15 BC 24 00 15 BE 14 00 00 00 00 00 28
	00 15 BE 28 00 15 C0 9E 00 15 C3 3E 00 15 C3 62 00 15 C7 26 00 00 00 00 00 28
	00 15 CA 18 00 15 CE AC 00 15 CF F4 00 15 D0 0E 00 15 D0 A0 00 00 00 00 00 28
	00 15 D0 B4 00 15 D2 82 00 15 D8 96 00 15 D8 98 00 15 D9 8C 00 00 00 00 00 63
	00 15 F3 30 00 15 F3 3C 00 15 F3 D6 00 15 F3 DC 00 15 F3 EE 00 00 00 00 00 63
	00 15 F3 F0 00 15 F4 9C 00 15 F4 A0 00 15 F4 B2 00 15 F4 B4 00 00 00 00 00 63
	00 15 DB 82 00 15 DC B6 00 15 DE 04 00 15 DE 1E 00 15 DE 30 00 00 00 00 00 63
	00 15 DE 58 00 15 E1 86 00 15 E3 1A 00 15 E3 2E 00 15 E4 F0 00 00 00 00 00 2D
	00 15 E6 30 00 15 E8 40 00 15 F1 22 00 15 F1 46 00 15 F3 2E 00 00 00 00 00 28
----------------------------------------------------------------------------------
*/
const struct MotionSetting Stage2MotionTbl[]={
	{0x15f806,0x15fb8c,0x16014c,0x160170,0x160238,0,0x1e},//场景1 红孩儿开场
	{0x159f7a,0x15a1d8,0x15a85e,0x15a8a4,0x15a970,0,0x63},//场景2 火炎洞开始
	{0x15a9e4,0x15ae5c,0x15b582,0x15b5ce,0x15b5e0,0,0x3c},//场景3 火炎洞密室（3个箱3个门处）
	{0x15b5f4,0x15bac8,0x15bc10,0x15bc24,0x15be14,0,0x28},//场景4 火炎洞密室2（有射箭）
	{0x15be28,0x15c09e,0x15c33e,0x15c362,0x15c726,0,0x28},//场景5 火炎洞密室3（有2个骷髅上吊）
	{0x15ca18,0x15ceac,0x15cff4,0x15d00e,0x15d0a0,0,0x28},//场景6 火炎洞密室4（一直落石）
	{0x15d0b4,0x15d282,0x15d896,0x15d898,0x15d98c,0,0x63},//场景7 红孩儿主战场
	{0x15f330,0x15f33c,0x15f3d6,0x15f3dc,0x15f3ee,0,0x63},//场景8 红孩儿演示动画
	{0x15f3f0,0x15f49c,0x15f4a0,0x15f4b2,0x15f4b4,0,0x63},//场景9 红孩儿演示动画2
	{0x15db82,0x15dcb6,0x15de04,0x15de1e,0x15de30,0,0x63},//场景10 红孩儿逃跑后的战场
	{0x15de58,0x15e186,0x15e31a,0x15e32e,0x15e4f0,0,0x2d},//场景11 第二场景云端
	{0x15e630,0x15e840,0x15f122,0x15f146,0x15f32e,0,0x28},//场景12 第三场景枯松涧洞口前
};






/*
----------------------------------------------------------------------------------
第三关场景表-原版 by 飞天雪
更新日期:2020-04-30
说明：
第三关 车迟国
DAT_2264a6:
    00 16 5B 7A 00 16 62 D8 00 16 6E 02 00 16 6E 1C 00 16 6F 08 00 00 00 00 00 63
    00 16 18 72 00 16 1E F8 00 16 23 3A 00 16 23 6A 00 16 25 52 00 00 00 00 00 63
    00 16 27 D6 00 16 2E BE 00 16 31 02 00 16 31 26 00 16 31 FE 00 00 00 00 00 63
    00 16 33 6C 00 16 35 1A 00 16 37 34 00 16 37 36 00 16 37 48 00 00 00 00 00 23
    00 16 3D 84 00 16 43 FC 00 16 44 F2 00 16 45 06 00 16 46 94 00 00 00 00 00 63
    00 16 48 9C 00 16 4A B2 00 16 4F CE 00 16 4F D0 00 16 4F D2 00 00 00 00 00 3C
    00 16 3D 84 00 16 43 FC 00 16 44 F2 00 16 45 06 00 16 46 94 00 00 00 00 00 63
    00 16 53 00 00 16 54 76 00 16 56 B0 00 16 56 C4 00 16 57 04 00 00 00 00 00 63
    00 16 58 44 00 16 59 54 00 16 5B 2C 00 16 5B 40 00 16 5B 52 00 00 00 00 00 63
	----------------------------------------------------------------------------------
*/
const struct MotionSetting Stage3MotionTbl[]={
	{0x165B7A,0x1662D8,0x166E02,0x166E1C,0x166F08,0,0x63},//场景1 车迟国开场入口
	{0x161872,0x161EF8,0x16233A,0x16236A,0x162552,0,0x63},//场景2 鹿力仙
	{0x1627D6,0x162EBE,0x163102,0x163126,0x1631FE,0,0x63},//场景3 羊力仙
	{0x16336C,0x16351A,0x163734,0x163736,0x163748,0,0x23},//场景4 鹿力仙A洞黑暗密室
	{0x163D84,0x1643FC,0x1644F2,0x164506,0x164694,0,0x63},//场景5 虎力仙出场处
	{0x16489C,0x164AB2,0x164FCE,0x164FD0,0x164FD2,0,0x3C},//场景6 鹿力仙隐藏密室打木桶
	{0x163D84,0x1643FC,0x1644F2,0x164506,0x164694,0,0x63},//场景7 虎力仙密室出来后的战场
	{0x165300,0x165476,0x1656B0,0x1656C4,0x165704,0,0x63},//场景8 蝎子洞五行门处
	{0x165844,0x165954,0x165B2C,0x165B40,0x165B52,0,0x63},//场景9 虎力仙密室
};

/*
----------------------------------------------------------------------------------
第四关场景表-原版 by 飞天雪
更新日期:2020-04-30
说明：
第四关 通天河
DAT_23b510:
    00 16 96 EE 00 16 97 8A 00 16 9B FC 00 16 9C 12 00 16 9C 10 00 16 9C 3E 00 63
    00 16 A0 4E 00 16 A6 80 00 16 AA EE 00 16 AA FC 00 16 AD 1C 00 16 AE 4E 00 63
    00 16 C8 7C 00 16 C9 F6 00 16 C9 FA 00 16 CA 08 00 16 CA 0A 00 16 CA 18 00 63
    00 16 B0 32 00 16 B3 66 00 16 B5 44 00 16 B5 58 00 16 B6 B4 00 16 B6 B6 00 32
    00 16 B8 92 00 16 BA 5E 00 16 BA 66 00 16 BA 80 00 16 BA 82 00 16 BA 5C 00 32
    00 16 BD 78 00 16 BF 9E 00 16 C5 CE 00 16 C5 E2 00 16 C5 F4 00 16 BE E2 00 63
	----------------------------------------------------------------------------------
*/
const struct MotionSetting Stage4MotionTbl[]={
	{0x1696EE,0x16978A,0x169BFC,0x169C12,0x169C10,0x169C3E,0x63},//场景1 开场通天河石碑处
	{0x16A04E,0x16A680,0x16AAEE,0x16AAFC,0x16AD1C,0x16AE4E,0x63},//场景2 海胆王场景
	{0x16C87C,0x16C9F6,0x16C9FA,0x16CA08,0x16CA0A,0x16CA18,0x63},//场景3 金鱼精演示动画场景
	{0x16B032,0x16B366,0x16B544,0x16B558,0x16B6B4,0x16B6B6,0x32},//场景4 下水后打开贝壳上去的路
	{0x16B892,0x16BA5E,0x16BA66,0x16BA80,0x16BA82,0x16BA5C,0x32},//场景5 大水怪演示场景
	{0x16BD78,0x16BF9E,0x16C5CE,0x16C5E2,0x16C5F4,0x16BEE2,0x63},//场景6 水怪地图开场处
};

/*
----------------------------------------------------------------------------------
第五关场景表-原版 by 飞天雪
更新日期:2020-04-30
说明：
第五关 盘丝洞
DAT_24dd0a:
    00 17 15 B6 00 17 17 A6 00 17 1A C0 00 17 1A D0 00 17 1A EC 00 17 17 50 00 19
    00 17 1A EE 00 17 1C C8 00 17 1A C0 00 17 1A D0 00 17 1A EC 00 17 1C 72 00 19
    00 17 1F 7A 00 17 21 46 00 17 24 54 00 17 1A D0 00 17 1A EC 00 17 20 EE 00 19
    00 16 F1 EC 00 16 F3 7E 00 16 F5 E6 00 16 F5 E8 00 16 F6 04 00 16 F3 28 00 32
    00 16 FB 5E 00 17 00 68 00 17 09 5A 00 17 09 84 00 17 09 A0 00 17 00 12 00 63
    00 17 0C C8 00 17 0E B8 00 17 11 F0 00 17 11 F2 00 17 12 14 00 17 0E B6 00 63
    00 17 0B AC 00 17 00 68 00 17 0C 8A 00 17 09 84 00 17 09 A0 00 17 0C 88 00 63
    00 17 27 62 00 17 29 3E 00 17 29 E8 00 17 29 EA 00 17 29 FC 00 17 28 D8 00 3C
    00 17 2A 12 00 17 2C 24 00 17 2D 16 00 17 2D 18 00 17 2D 2A 00 17 2C 22 00 63
	----------------------------------------------------------------------------------
*/
const struct MotionSetting Stage5MotionTbl[]={
	{0x1715B6,0x1717A6,0x171AC0,0x171AD0,0x171AEC,0x171750,0x19},//场景1 盘丝洞第一个漂浮平台
	{0x171AEE,0x171CC8,0x171AC0,0x171AD0,0x171AEC,0x171C72,0x19},//场景2 盘丝洞第二个漂浮平台
	{0x171F7A,0x172146,0x172454,0x171AD0,0x171AEC,0x1720EE,0x19},//场景3 盘丝洞第三个漂浮平台三个入口处
	{0x16F1EC,0x16F37E,0x16F5E6,0x16F5E8,0x16F604,0x16F328,0x32},//场景4 盘丝洞第四个漂浮平台盘丝洞入口
	{0x16FB5E,0x170068,0x17095A,0x170984,0x1709A0,0x170012,0x63},//场景5 蜘蛛精洗澡开场处
	{0x170CC8,0x170EB8,0x1711F0,0x1711F2,0x171214,0x170EB6,0x63},//场景6 蜈蚣精战场
	{0x170BAC,0x170068,0x170C8A,0x170984,0x1709A0,0x170C88,0x63},//场景7 蜘蛛精洞出来后蜘蛛王战场
	{0x172762,0x17293E,0x1729E8,0x1729EA,0x1729FC,0x1728D8,0x3C},//场景8 八卦处
	{0x172A12,0x172C24,0x172D16,0x172D18,0x172D2A,0x172C22,0x63},//场景9 蜘蛛精战场
};
/*
----------------------------------------------------------------------------------
第六关场景表-原版 by 飞天雪
更新日期:2020-04-30
说明：
第六关 狮驼岭
DAT_262204:
    00 17 70 36 00 17 74 BC 00 17 77 3C 00 17 77 44 00 17 78 AE 00 17 7A 88 00 63
    00 17 48 2A 00 17 4D C8 00 17 50 4C 00 17 50 54 00 17 52 5E 00 17 52 D8 00 63
    00 17 5A D2 00 17 5F 40 00 17 62 9A 00 17 62 B4 00 17 64 6A 00 17 64 6C 00 63
    00 17 65 28 00 17 69 10 00 17 6B A2 00 17 6B AA 00 17 6C B2 00 17 6D 40 00 63
    00 17 8A AA 00 17 8B 50 00 17 8C 20 00 17 8C 2E 00 17 8C 30 00 17 8C 32 00 63
    00 17 85 6C 00 17 87 5A 00 17 8A 0E 00 17 8A 22 00 17 8A 6A 00 17 86 EE 00 63
    00 17 84 18 00 17 84 E6 00 17 84 FA 00 17 84 FC 00 17 85 0E 00 17 84 E4 00 63
	----------------------------------------------------------------------------------
*/
const struct MotionSetting Stage6MotionTbl[]={
	{0x177036,0x1774BC,0x17773C,0x177744,0x1778AE,0x177A88,0x63},//场景1 大鹏王战场
	{0x17482A,0x174DC8,0x17504C,0x175054,0x17525E,0x1752D8,0x63},//场景2 青狮王场景
	{0x175AD2,0x175F40,0x17629A,0x1762B4,0x17646A,0x17646C,0x63},//场景3 白象王洞前
	{0x176528,0x176910,0x176BA2,0x176BAA,0x176CB2,0x176D40,0x63},//场景4 八卦门白象王战场
	{0x178AAA,0x178B50,0x178C20,0x178C2E,0x178C30,0x178C32,0x63},//场景5 白象王逃跑后跳下去下坠地图
	{0x17856C,0x17875A,0x178A0E,0x178A22,0x178A6A,0x1786EE,0x63},//场景6 蝙蝠洞
	{0x178418,0x1784E6,0x1784FA,0x1784FC,0x17850E,0x1784E4,0x63},//场景7 蝙蝠洞演示动画处
};
/*
----------------------------------------------------------------------------------
第七关场景表-原版 by 飞天雪
更新日期:2020-04-30
说明：
第七关 陷空山
DAT_279d2e:
    00 17 F8 50 00 17 FF 5E 00 18 09 D4 00 18 0A 30 00 18 0B 1C 00 00 00 00 00 63
    00 17 AF 7A 00 17 B2 E4 00 17 BF 20 00 17 BF 44 00 17 C0 06 00 00 00 00 00 50
    00 17 C0 30 00 17 C5 FE 00 17 CC 88 00 17 CC 9C 00 17 CE 9E 00 00 00 00 00 63
    00 17 D0 46 00 17 D3 A6 00 17 D5 72 00 17 D5 86 00 17 D7 1C 00 00 00 00 00 3C
    00 17 D7 7C 00 17 D8 C8 00 17 DF 36 00 17 DF 4A 00 17 E0 04 00 00 00 00 00 1E
    00 17 E1 EC 00 17 E3 30 00 17 E6 36 00 17 E6 5A 00 17 E7 18 00 00 00 00 00 63
    00 17 E8 98 00 17 E9 20 00 17 E9 AE 00 17 E9 BC 00 17 E9 BE 00 00 00 00 00 1E
    00 17 EB AC 00 17 EE 2A 00 17 F4 C2 00 17 F4 D6 00 17 F5 A4 00 00 00 00 00 28
    00 17 F5 C4 00 17 F6 B8 00 17 F6 BC 00 17 F6 D0 00 17 F6 D2 00 00 00 00 00 0A
	----------------------------------------------------------------------------------
*/
const struct MotionSetting Stage7MotionTbl[]={
	{0x17F850,0x17FF5E,0x1809D4,0x180A30,0x180B1C,0,0x63},//场景1 陷空山开场处
	{0x17AF7A,0x17B2E4,0x17BF20,0x17BF44,0x17C006,0,0x50},//场景2 陷空山酒宴走廊处
	{0x17C030,0x17C5FE,0x17CC88,0x17CC9C,0x17CE9E,0,0x63},//场景3 钱鼠王出场唐僧被绑处
	{0x17D046,0x17D3A6,0x17D572,0x17D586,0x17D71C,0,0x3C},//场景4 老鼠尾巴处
	{0x17D77C,0x17D8C8,0x17DF36,0x17DF4A,0x17E004,0,0x1E},//场景5 陷空山跳下去的洞府
	{0x17E1EC,0x17E330,0x17E636,0x17E65A,0x17E718,0,0x63},//场景6 钱鼠王主战场
	{0x17E898,0x17E920,0x17E9AE,0x17E9BC,0x17E9BE,0,0x1E},//场景7 陷空山掉落过场地图
	{0x17EBAC,0x17EE2A,0x17F4C2,0x17F4D6,0x17F5A4,0,0x28},//场景8 小老鼠地图
	{0x17F5C4,0x17F6B8,0x17F6BC,0x17F6D0,0x17F6D2,0,0xA}, //场景9 钱鼠王演示动画处
};
/*
----------------------------------------------------------------------------------
第八关场景表-原版 by 飞天雪
更新日期:2020-04-30
说明：
第八关 火焰山
DAT_286934:
    00 18 26 96 00 18 2C 16 00 18 2F 5E 00 18 30 AE 00 18 32 2A 00 18 32 2C 00 63
    00 18 41 E2 00 18 43 D6 00 18 48 7A 00 18 48 80 00 18 48 92 00 18 43 7E 00 63
    00 18 4B 20 00 18 4D B6 00 18 53 D6 00 18 53 EA 00 18 54 B4 00 18 55 42 00 63
    00 18 35 24 00 18 39 32 00 18 3F A8 00 18 3F E2 00 18 3F F4 00 18 36 2E 00 63
    00 18 56 24 00 18 58 2E 00 18 58 36 00 18 58 42 00 18 58 44 00 18 58 2C 00 63
    00 18 58 46 00 18 5A 5E 00 18 5A 72 00 18 5A 80 00 18 5A 92 00 18 5A 94 00 63
	----------------------------------------------------------------------------------
*/
const struct MotionSetting Stage8MotionTbl[]={
	{0x182696,0x182C16,0x182F5E,0x1830AE,0x18322A,0x18322C,0x63},//场景1 开场牛魔王处
	{0x1841E2,0x1843D6,0x18487A,0x184880,0x184892,0x18437E,0x63},//场景2 火龙地图
	{0x184B20,0x184DB6,0x1853D6,0x1853EA,0x1854B4,0x185542,0x63},//场景3 牛魔王第二战场
	{0x183524,0x183932,0x183FA8,0x183FE2,0x183FF4,0x18362E,0x63},//场景4 幻魔场景
	{0x185624,0x18582E,0x185836,0x185842,0x185844,0x18582C,0x63},//场景5 火龙演示动画处
	{0x185846,0x185A5E,0x185A72,0x185A80,0x185A92,0x185A94,0x63},//场景6 大幻魔演示动画处
};







/*
-----------------------------------------------------
	第一关 关卡函数 by 海叔
	更新日期:2020-04-30
	说明:将关卡函数外置
-----------------------------------------------------
*/
void Stage1Func1(short Motion){
	FUNC32(Stage1MotionTbl[Motion].Func1)();
	return;
}

void Stage1Func2(short Motion){
	FUNC32(Stage1MotionTbl[Motion].Func2)();
	return;
}

void Stage1Func3(short Motion){
	FUNC32(Stage1MotionTbl[Motion].Func3)();
	return;
}

void Stage1Func4(short Motion,int param_2){
	FUNC32(Stage1MotionTbl[Motion].Func4)(param_2);
	return;
}

void Stage1Func5(short Motion,int param_2){
	FUNC32(Stage1MotionTbl[Motion].Func5)(param_2);
	return;
}

void Stage1Func6(short Motion,int param_2){
	FUNC32(Stage1MotionTbl[Motion].Func6)(param_2);
	return;
}

short Stage1Func7(short Motion){
	return Stage1MotionTbl[Motion].Time;
}

/*
-----------------------------------------------------
	第二关 关卡函数 by 海叔
	更新日期:2020-04-30
	说明:将关卡函数外置
-----------------------------------------------------
*/
void Stage2Func1(short Motion){
	FUNC32(Stage2MotionTbl[Motion].Func1)();
	return;
}

void Stage2Func2(short Motion){
	FUNC32(Stage2MotionTbl[Motion].Func2)();
	return;
}

void Stage2Func3(short Motion){
	FUNC32(Stage2MotionTbl[Motion].Func3)();
	return;
}

void Stage2Func4(short Motion,int param_2){
	FUNC32(Stage2MotionTbl[Motion].Func4)(param_2);
	return;
}

void Stage2Func5(short Motion,int param_2){
	FUNC32(Stage2MotionTbl[Motion].Func5)(param_2);
	return;
}

void Stage2Func6(short Motion,int param_2){
	FUNC32(Stage2MotionTbl[Motion].Func6)(param_2);
	return;
}

short Stage2Func7(short Motion){
	return Stage2MotionTbl[Motion].Time;
}


/*
-----------------------------------------------------
	第三关 关卡函数 by 海叔
	更新日期:2020-04-30
	说明:将关卡函数外置
-----------------------------------------------------
*/
void Stage3Func1(short Motion){
	FUNC32(Stage3MotionTbl[Motion].Func1)();
	return;
}

void Stage3Func2(short Motion){
	FUNC32(Stage3MotionTbl[Motion].Func2)();
	return;
}

void Stage3Func3(short Motion){
	FUNC32(Stage3MotionTbl[Motion].Func3)();
	return;
}

void Stage3Func4(short Motion,int param_2){
	FUNC32(Stage3MotionTbl[Motion].Func4)(param_2);
	return;
}

void Stage3Func5(short Motion,int param_2){
	FUNC32(Stage3MotionTbl[Motion].Func5)(param_2);
	return;
}

void Stage3Func6(short Motion,int param_2){
	FUNC32(Stage3MotionTbl[Motion].Func6)(param_2);
	return;
}

short Stage3Func7(short Motion){
	return Stage3MotionTbl[Motion].Time;
}

/*
-----------------------------------------------------
	第四关 关卡函数 by 海叔
	更新日期:2020-04-30
	说明:将关卡函数外置
-----------------------------------------------------
*/
void Stage4Func1(short Motion){
	FUNC32(Stage4MotionTbl[Motion].Func1)();
	return;
}

void Stage4Func2(short Motion){
	FUNC32(Stage4MotionTbl[Motion].Func2)();
	return;
}

void Stage4Func3(short Motion){
	FUNC32(Stage4MotionTbl[Motion].Func3)();
	return;
}

void Stage4Func4(short Motion,int param_2){
	FUNC32(Stage4MotionTbl[Motion].Func4)(param_2);
	return;
}

void Stage4Func5(short Motion,int param_2){
	FUNC32(Stage4MotionTbl[Motion].Func5)(param_2);
	return;
}

void Stage4Func6(short Motion,int param_2){
	FUNC32(Stage4MotionTbl[Motion].Func6)(param_2);
	return;
}

short Stage4Func7(short Motion){
	return Stage4MotionTbl[Motion].Time;
}

/*
-----------------------------------------------------
	第五关 关卡函数 by 海叔
	更新日期:2020-04-30
	说明:将关卡函数外置
-----------------------------------------------------
*/
void Stage5Func1(short Motion){
	FUNC32(Stage5MotionTbl[Motion].Func1)();
	return;
}

void Stage5Func2(short Motion){
	FUNC32(Stage5MotionTbl[Motion].Func2)();
	return;
}

void Stage5Func3(short Motion){
	FUNC32(Stage5MotionTbl[Motion].Func3)();
	return;
}

void Stage5Func4(short Motion,int param_2){
	FUNC32(Stage5MotionTbl[Motion].Func4)(param_2);
	return;
}

void Stage5Func5(short Motion,int param_2){
	FUNC32(Stage5MotionTbl[Motion].Func5)(param_2);
	return;
}

void Stage5Func6(short Motion,int param_2){
	FUNC32(Stage5MotionTbl[Motion].Func6)(param_2);
	return;
}

short Stage5Func7(short Motion){
	return Stage5MotionTbl[Motion].Time;
}

/*
-----------------------------------------------------
	第六关 关卡函数 by 海叔
	更新日期:2020-04-30
	说明:将关卡函数外置
-----------------------------------------------------
*/
void Stage6Func1(short Motion){
	FUNC32(Stage6MotionTbl[Motion].Func1)();
	return;
}

void Stage6Func2(short Motion){
	FUNC32(Stage6MotionTbl[Motion].Func2)();
	return;
}

void Stage6Func3(short Motion){
	FUNC32(Stage6MotionTbl[Motion].Func3)();
	return;
}

void Stage6Func4(short Motion,int param_2){
	FUNC32(Stage6MotionTbl[Motion].Func4)(param_2);
	return;
}

void Stage6Func5(short Motion,int param_2){
	FUNC32(Stage6MotionTbl[Motion].Func5)(param_2);
	return;
}

void Stage6Func6(short Motion,int param_2){
	FUNC32(Stage6MotionTbl[Motion].Func6)(param_2);
	return;
}

short Stage6Func7(short Motion){
	return Stage6MotionTbl[Motion].Time;
}

/*
-----------------------------------------------------
	第七关 关卡函数 by 海叔
	更新日期:2020-04-30
	说明:将关卡函数外置
-----------------------------------------------------
*/
void Stage7Func1(short Motion){
	FUNC32(Stage7MotionTbl[Motion].Func1)();
	return;
}

void Stage7Func2(short Motion){
	FUNC32(Stage7MotionTbl[Motion].Func2)();
	return;
}

void Stage7Func3(short Motion){
	FUNC32(Stage7MotionTbl[Motion].Func3)();
	return;
}

void Stage7Func4(short Motion,int param_2){
	FUNC32(Stage7MotionTbl[Motion].Func4)(param_2);
	return;
}

void Stage7Func5(short Motion,int param_2){
	FUNC32(Stage7MotionTbl[Motion].Func5)(param_2);
	return;
}

void Stage7Func6(short Motion,int param_2){
	FUNC32(Stage7MotionTbl[Motion].Func6)(param_2);
	return;
}

short Stage7Func7(short Motion){
	return Stage7MotionTbl[Motion].Time;
}

/*
-----------------------------------------------------
	第八关 关卡函数 by 海叔
	更新日期:2020-04-30
	说明:将关卡函数外置
-----------------------------------------------------
*/
void Stage8Func1(short Motion){
	FUNC32(Stage8MotionTbl[Motion].Func1)();
	return;
}

void Stage8Func2(short Motion){
	FUNC32(Stage8MotionTbl[Motion].Func2)();
	return;
}

void Stage8Func3(short Motion){
	FUNC32(Stage8MotionTbl[Motion].Func3)();
	return;
}

void Stage8Func4(short Motion,int param_2){
	FUNC32(Stage8MotionTbl[Motion].Func4)(param_2);
	return;
}

void Stage8Func5(short Motion,int param_2){
	FUNC32(Stage8MotionTbl[Motion].Func5)(param_2);
	return;
}

void Stage8Func6(short Motion,int param_2){
	FUNC32(Stage8MotionTbl[Motion].Func6)(param_2);
	return;
}

short Stage8Func7(short Motion){
	return Stage8MotionTbl[Motion].Time;
}
/*
---------------------------------------------------------------------------------------------------------------------------------------------
游戏关卡总表-原版 by 海叔
更新日期:2020-04-29
说明：
外置游戏关卡表格。
DAT_18B570:
	01 00 00 15 7F B2 00 15 80 4C 00 15 80 6E 00 15 80 F2 00 15 81 18 00 15 81 A4 00 00 00 01 00 31 E5 6C 00 00 00 06 00 15 81 CA //第一关 平顶山
	01 00 00 16 02 3A 00 16 02 C0 00 16 02 E8 00 16 03 68 00 16 03 8E 00 16 04 16 00 00 00 03 00 32 9D E2 00 00 00 09 00 16 07 4E //第二关 枯松涧
	01 00 00 16 6F 0A 00 16 6F 8E 00 16 6F B6 00 16 70 38 00 16 70 5E 00 16 70 E0 00 00 00 05 00 33 02 C8 00 00 00 06 00 16 74 6C //第三关 车迟国
	01 00 00 16 CA 1A 00 16 CA A8 00 16 CA D0 00 16 CB 5E 00 16 CB 84 00 16 CC 0E 00 00 00 07 00 33 55 EC 00 00 00 08 00 16 CC 34 //第四关 通天河
	01 00 00 17 2E 2C 00 17 2E A6 00 17 2E CE 00 17 2F 52 00 17 2F 78 00 17 2F 9E 00 00 00 0B 00 32 3D 96 00 00 00 06 00 17 2F C4 //第五关 盘丝洞
	01 00 00 17 6D A0 00 17 6E 26 00 17 6E 48 00 17 6E CE 00 17 6E F4 00 17 6F 1A 00 00 00 0C 00 33 BB 86 00 00 00 07 00 17 6F 40 //第六关 狮驼岭
	01 00 00 18 0B 1E 00 18 0B A4 00 18 0B CC 00 18 0C 52 00 18 0C 78 00 18 0C 9E 00 00 00 0F 00 33 E9 16 00 00 00 04 00 18 0F 6C //第七关 陷空山
	01 00 00 18 5A 96 00 18 5B 1C 00 18 5B 44 00 18 5B CA 00 18 5B F0 00 18 5C 16 00 00 00 11 00 34 4E 6E 00 00 00 06 00 18 5C 3C //第八关 火焰山

---------------------------------------------------------------------------------------------------------------------------------------------
*/
/*
const struct StageSetting StageTbl[]={
	{0x01,0x00,0x157fb2,0x15804c,0x15806e,0x1580f2,0x158118,0x1581a4,0x000001,0x31e56c,0x000006,0x1581ca},//第一关 平顶山
	{0x01,0x00,0x16023a,0x1602c0,0x1602e8,0x160368,0x16038e,0x160416,0x000003,0x329de2,0x000009,0x16074e},//第二关 枯松涧
	{0x01,0x00,0x166f0a,0x166f8e,0x166fb6,0x167038,0x16705e,0x1670e0,0x000005,0x3302c8,0x000006,0x16746c},//第三关 车迟国
	{0x01,0x00,0x16ca1a,0x16caa8,0x16cad0,0x16cb5e,0x16cb84,0x16cc0e,0x000007,0x3355ec,0x000008,0x16cc34},//第四关 通天河
	{0x01,0x00,0x172e2c,0x172ea6,0x172ece,0x172f52,0x172f78,0x172f9e,0x00000b,0x323d96,0x000006,0x172fc4},//第五关 盘丝洞
	{0x01,0x00,0x176da0,0x176e26,0x176e48,0x176ece,0x176ef4,0x176f1a,0x00000c,0x33bb86,0x000007,0x176f40},//第六关 狮驼岭
	{0x01,0x00,0x180b1e,0x180ba4,0x180bcc,0x180c52,0x180c78,0x180c9e,0x00000f,0x33e916,0x000004,0x180f6c},//第七关 陷空山
	{0x01,0x00,0x185a96,0x185b1c,0x185b44,0x185bca,0x185bf0,0x185c16,0x000011,0x344e6e,0x000006,0x185c3c},//第八关 火焰山
};
*/
const struct StageSetting StageTbl[]={
	{0x01,0x00,(int)&Stage1Func1,(int)&Stage1Func2,(int)&Stage1Func3,(int)&Stage1Func4,(int)&Stage1Func5,(int)&Stage1Func6,0x000001,0x31e56c,0x000006,(int)&Stage1Func7},//第一关 平顶山
	{0x01,0x00,(int)&Stage2Func1,(int)&Stage2Func2,(int)&Stage2Func3,(int)&Stage2Func4,(int)&Stage2Func5,0x160416,0x000003,0x329de2,0x000009,(int)&Stage2Func7},//第二关 枯松涧
	{0x01,0x00,(int)&Stage3Func1,(int)&Stage3Func2,(int)&Stage3Func3,(int)&Stage3Func4,(int)&Stage3Func5,0x1670e0,0x000005,0x3302c8,0x000006,(int)&Stage3Func7},//第三关 车迟国
	{0x01,0x00,(int)&Stage4Func1,(int)&Stage4Func2,(int)&Stage4Func3,(int)&Stage4Func4,(int)&Stage4Func5,(int)&Stage4Func6,0x000007,0x3355ec,0x000008,(int)&Stage4Func7},//第四关 通天河
	{0x01,0x00,(int)&Stage5Func1,(int)&Stage5Func2,(int)&Stage5Func3,(int)&Stage5Func4,(int)&Stage5Func5,(int)&Stage5Func6,0x00000b,0x323d96,0x000006,(int)&Stage5Func7},//第五关 盘丝洞
	{0x01,0x00,(int)&Stage6Func1,(int)&Stage6Func2,(int)&Stage6Func3,(int)&Stage6Func4,(int)&Stage6Func5,(int)&Stage6Func6,0x00000c,0x33bb86,0x000007,(int)&Stage6Func7},//第六关 狮驼岭
	{0x01,0x00,(int)&Stage7Func1,(int)&Stage7Func2,(int)&Stage7Func3,(int)&Stage7Func4,(int)&Stage7Func5,0x180c9e,0x00000f,0x33e916,0x000004,(int)&Stage7Func7},//第七关 陷空山
	{0x01,0x00,(int)&Stage8Func1,(int)&Stage8Func2,(int)&Stage8Func3,(int)&Stage8Func4,(int)&Stage8Func5,(int)&Stage8Func6,0x000011,0x344e6e,0x000006,(int)&Stage8Func7},//第八关 火焰山
};